import request from '@/utils/request'

// 查询代理商
export function agencyList(query) {
  return request({
    url: '/base/agency/list',
    method: 'get',
    params: query
  })
}
// 新增代理商
export function addAgency(data) {
  return request({
    url: '/base/agency',
    method: 'post',
    data: data
  })
}


// 获取代理商详细信息
export function agencyById(id) {
  return request({
    url: `/base/agency/${id}`,
    method: 'get',
  })
}


// 修改代理商
export function eitHagency(data) {
  return request({
    url: '/base/agency',
    method: 'put',
    data: data
  })
}

// 删除代理商
export function delAgency(id) {
  return request({
    url: `/base/agency/${id}`,
    method: 'delete'
  })
}

// 审核代理商实名认证
export function auditAuth(query) {
  return request({
    url: '/base/agency/audit-auth',
    method: 'get',
    params: query
  })
}


// 代理商已激活
export function agencyactive(query) {
  return request({
    url: '/base/agency/active',
    method: 'get',
    params: query
  })
}

// 驳回实名认证
export function refuseauth(query) {
  return request({
    url: '/base/agency/refuse-auth',
    method: 'get',
    params: query
  })
}

// 医药已驳回协议
export function medicalRepresentativeBh(query) {
  return request({
    url: '/base/agency/refuse-agreement',
    method: 'get',
    params: query
  })
}   


// 删除医药代表
export function delMedicalRepresentative(id) {
  return request({
    url: `/base/agency/${id}`,
    method: 'delete'
  })
}

// 启用医药代表
export function delMedicalRepresentativeenable(id) {
  return request({
    url: `/base/agency/enable/${id}`,
    method: 'post'
  })
}